1. Field of the Invention
The present invention relates to data processing for starting up an electronic apparatus.
2. Related Background Art
In the field of digital camera and the like, large scale software including Graphical User Interface (GUI) using a Windows system is stored in a read only memory (ROM) and executed. Such a system is required to drive a 32-bit reduced instruction set computer (RISC) processor and a large capacity dynamic random access memory (DRAM) by using a compact battery.
It is therefore usual to turn off completely the power source when the apparatus is not used, and to turn on immediately before the apparatus is used. In the case of a digital camera, the time taken to start to use the camera after the power is turned on is preferably as short as possible in order not to lose a photographing chance. It is therefore desired to realize a computer system having a short system start-up time. The system start-up time includes a time taken to initialize an operating system (OS) and drivers and a time taken to transfer initial values of data segments of a high-level language such as a C language. This start-up time is required before initialization during operational procedure of the digital camera, and is called overhead. Prior art of activating a high-level language from ROM is described in Japanese Patent Application Laid-Open No. 2004-348677.
In order to implement a ROM program using a high-level language, typically a C language, initialization is required to allow the high-level language to operate. There is a tendency that the time taken to set initial values in variable areas becomes long as the program scale becomes large. These variables are called “static variables with initialization” in the C language. The variable area is called a data segment and assigned to a predetermined address of a RAM by a programmer.
Initial values are written in ROM at predetermined addresses, and copied from ROM to data segments of RAM by a start-up routine of the C language. In the C language specifications, static variables whose initial values are not assigned are initialized to 0. These static variables are developed into a RAM area called a BSS area. In addition to transfer of initial values from ROM to RAM, a process of changing variables developed into the BSS area to 0 s (0-clear) takes a time during the start-up.
High speed processing by CPU is required in many cases, such as GUI expression using many animations, file compression by software, and image processing for printing.
Speed Difference Between ROM and RAM
A clock of a RISC processor tends to increase year after year, and high speed operations at 100 Mhz or 200 Mhz are not rare. However, an access speed of ROM is very slow as about 120 ns, as compared to a processor speed. In order to make compact a camera, not a 32-bit bus but a 16-bit bus is used for connection so that it is not rare that about 300 ns is taken to fetch one machine instruction.
A read speed of RAM such as an SDRAM is very fast as compared to a fetch command from ROM, because burst read is possible. In such a system, a cache memory exists between CPU and a memory. Therefore, read/write between DRAM and cache is performed always in a burst mode so that a fetch can be executed in average at twice to several times (10 to several tens ns) the internal speed. Namely, when the cache mishits, data can be read at high speed from RAM at about ten times the speed of reading it from ROM.
Under these circumstances, all programs in ROM are often copied once to RAM. However, since all programs in ROM are required to be copied to RAM upon start-up, there arises a problem that the start-up time becomes very long, several hundreds ms to several tens sec. This approach is therefore not suitable for an apparatus required to shorten the start-up time, such as a digital camera.
It is difficult to shorten the time taken to copy initial values of variables from ROM to RAM, this time occupying a large part of the start-up time. This time is approximately several hundreds ms. During this time, the computer system can execute neither effective user programs nor OS initialization.
From the same reason, a basic input/output system (BIOS) of a personal computer is also copied to RAM to execute it. For example, a BIOS system has been devised such as described in Japanese Patent Application Laid-Open No. 2001-51858. This system is generally called a “shadow BIOS” and realized by transferring a drawing routine and the like in BIOS to RAM. The shadow BIOS is operated by disposing RAM at an address of an original ROM by using functions of a memory management unit (MMU). However, similar to the techniques described above, the techniques of the shadow BIOS are not suitable for a digital camera, because a transfer to RAM is explicitly executed during start-up.
According to conventional techniques described above, it is difficult to properly shorten a start-up time of an electronic apparatus such as a digital camera executing large scale software implemented in ROM.